<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title>黑龙江尔慧科技有限公司官网</title>
		<link href="css/all.css" rel="stylesheet" type="text/css">

		<!-- 产品中心轮播参数 -->
		<script>
			window.onresize = function() {
				var winWidth = document.body.clientWidth;
				if (winWidth <= 1180) {
					body.className = "grid-960";
				} else if (winWidth <= 1410) {
					body.className = "grid-1180";
				} else if (winWidth > 1410) {
					body.className = "grid-1410";
				} else {
					alert("do not know!");
				}
			}
		</script>
	</head>
	<body id="body">
		<script>
			//初始化状态显示样式判断
			var winWidth = document.body.clientWidth;
			if (winWidth <= 1180) {
				body.className = "grid-960";
			} else if (winWidth <= 1410) {
				body.className = "grid-1180";
			} else if (winWidth > 1410) {
				body.className = "grid-1410";
			} else {
				alert("do not know!");
			}
		</script>
		<!-- ↓↓↓导航↓↓↓ -->
		<div class="nav" style="position: fixed;top:0;z-index: 999;">
			<a href="#" style="float: left;"><img src="img/logo1.png" alt=""></a>
			<ul>
				<li><a href='index.html'>首页</a></li>
				<li><a href='kepu.html'>科普天地</a></li>
				<li><a href='chanpin.html'>产品中心</a></li>
				<li><a href='yuyue.html'>在线预约</a></li>
				<li><a href='guanyu.html'>关于我们</a></li>
			</ul>
		</div>
		<!-- ↓↓↓banner↓↓↓ -->
		<div class="banner">
<!-- 			<img src="img/banner.jpg" alt=""> -->
		</div>
		<!-- ↓↓↓产品中心↓↓↓ -->
		<div class="cpzx">
			<img src="img/cpzx.png">
		</div>
		<div class="wapper">
			<div class="section">
				<div class="activity" class="movie" id="activity-slide">
					<a href="javascript:void(0)" class="pg_left ps_pre"></a>
					<a href="javascript:void(0)" class="pg_right ps_next"></a>
					<ul class="clearfix">
						<li><a href="javascript:;"><img src="img/cp1.jpg"></a></li>
						<li><a href="javascript:;"><img src="img/cp2.jpg"></a></li>
						<li><a href="javascript:;"><img src="img/cp3.jpg"></a></li>
						<li><a href="javascript:;"><img src="img/cp4.jpg"></a></li>
						<li><a href="javascript:;"><img src="img/cp5.jpg"></a></li>
					</ul>
				</div>
			</div>
		</div>
		<!-- ↓↓↓页脚↓↓↓ -->
		<div class="foot">
			<ul>
				<li>地址：哈尔滨市南岗区中兴大道164号B3栋21层1号</li>
				<li>服务热线：<span>+86 15561839691</span></li>
				<li>邮箱：erhuitech@163.com</li>
			</ul>
			<img src="img/rwm.jpg">
		</div>
		<div class="foot1">
			Copyright© 2018-2019 &nbsp &nbsp <a href="http://www.miitbeian.gov.cn" target="view_window">ICP备案号：黑ICP备18008482号</a> &nbsp &nbsp 黑龙江尔慧科技有限公司版权所有All Rights Reserved
		</div>
	</body>
</html>

<script src="http://code.jquery.com/jquery-latest.js"></script>
<script>
	//首页图片滚动切换
	(function($) {
		$.photolist = function(a) {
			var w_li = a.find("li").width();
			var h_li = a.find("li").height();
			var margin_li = parseInt(a.find("li").css("marginLeft"));
			var now = 0;
			var num = 0;
			var addli = 0;
			var lisize = a.find("ul li").size();
			var htmlall = a.find("ul").html();

			//判断每次滚动数量
			/*
			var w_body = $("body").width();
			if(w_body <=1170){
			    var num = 3;
			}else if(w_body<= 1380){
			    var num = 4;
			}else if(w_body>1380){
			    var num = 5;
			}
			*/
			var num = 1;

			//判断需要添加的li节点数量
			var reminder = lisize % num;
			if (lisize % num != 0) {
				addli = num - reminder;
			} else {
				addli = 0;
			}
			addlist();
			//点击滚动事件
			photoscroll();

			$(window).resize(function() {
				//location.reload();
				now = 0;
				addli = 0;
				a.find("ul").html(htmlall); //html内容还原初始值
				a.find(".ps_next").show(); //按钮样式初始化
				a.find(".ps_pre").hide();
				//判断每次滚动数量
				/*
				var w_body = $("body").width();
				if(w_body <=1170){
				    var num = 3;
				}else if(w_body<= 1380){
				    var num = 4;
				}else if(w_body>1380){
				    var num = 5;
				}
				*/
				var num = 3;
				//判断需要添加的li节点数量
				var reminder = lisize % num;
				if (lisize % num != 0) {
					addli = num - reminder;
				} else {
					addli = 0;
				}
				addlist();
				w_li = a.find("li").width();
				margin_li = parseInt(a.find("li").css("marginLeft"));
				a.find("ul").css({
					"width": (w_li + margin_li * 2) * (lisize + addli)
				});
				a.find("ul").animate({
					"margin-left": 0
				}); //ul位置还原
				btnshow(now, parseInt((lisize + addli) / num), lisize, num);
			});


			function addlist() {
				for (i = 0; i < addli; i++) {
					var html = a.find("ul li").eq(i).html();
					a.find("ul").append("<li>" + html + "</li>");
				}
				a.find("ul").css({
					"width": (w_li + margin_li * 2) * (lisize + addli)
				});
				//console.log(a.find("ul li").size());
			}

			function photoscroll() {
				a.find(".ps_pre").on("click", function() { //console.log(num);    
					now--;
					if (now >= 0) {
						a.find("ul").animate({
							"margin-left": -now * num * (w_li + margin_li * 2)
						});
						btnshow(now, parseInt((lisize + addli) / num), lisize, num);
					}
				});

				a.find(".ps_next").on("click", function() { //console.log(num);    
					now++;
					if (now < (lisize + addli) / num) {
						a.find("ul").animate({
							"margin-left": -now * num * (w_li + margin_li * 2)
						});
						btnshow(now, parseInt((lisize + addli) / num), lisize, num);
					}
				});
				btnshow(now, parseInt((lisize + addli) / num), lisize, num);
			}
			/***
			参数说明：
			now:当前是第几组，默认是0
			c:总共有几组
			d:初始化时li的个数
			e:每组显示li个数
			***/
			function btnshow(now, c, d, e) {
				if (d <= e) { //如果初始化时li的个数小于一组要显示的数，则不显示pre和next按钮
					a.find(".ps_next").hide();
					a.find(".ps_pre").hide();
				} else if (now == 0) { //初始化now=0，显示第一组，只显示next
					a.find(".ps_next").show();
					a.find(".ps_pre").hide();
				} else if (now == c - 1) { //显示到最后一组，只显示pre
					a.find(".ps_next").hide();
					a.find(".ps_pre").show();
				} else { //显示中间组，pre和next都需要显示
					a.find(".ps_next").show();
					a.find(".ps_pre").show();
				}
			}
		}
	})(jQuery);
	$.photolist($("#activity-slide"));
</script>

<!-- 调用公共悬浮按钮代码 -->
<script language =javascript src ="js/xfan.js"></script>